<!doctype html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>问卷调查系统-我的问卷</title>
    <link rel="stylesheet" href="css/init.css">
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/index.css">
    <link rel="stylesheet" href="font/iconfont.css">
    <script src="js/common/util.js"></script>

    <script>
        if (getDataFromLocal("questionnaires").length === 0) {
            location.href = "new.html"
        }
    </script>
</head>

<body>
    <!--  头部  -->
    <div id="header" class="clear">
        <ul class="nav-list">
            <li class="nav-item active">
                <a href="index.html">
                    我的问卷
                </a>
            </li>
        </ul>
        <div class="avatar">
            <img src="img/avatar.jpg" alt="">
            <span>用户</span>
        </div>
    </div>

    <!-- 主体 -->
    <div id="main">
        <div class="container clear">
            <!-- 标题 -->
            <div class="main-head clear">
                <a href="edit.html" id="btn-new" class="fr btn btn-normal"><i class="iconfont icon-add"></i> 新建问卷</a>
                <button id="btn-multi-delete" class="fr btn"><i class="iconfont icon-ashbin"></i> 批量删除</button>
                <button style="display: none;" id="btn-confirm-delete" class="fr btn btn-danger"><i
                        class="iconfont icon-ashbin"></i> 确认删除
                </button>
            </div>
            <!-- 表格 -->
            <div class="table">
                <table>
                    <thead>
                        <tr>
                            <td id="table-choose" class="table-choose">
                                <input type="checkbox" id="checkbox-choose-all">
                                <label for="checkbox-choose-all">全选</label>
                            </td>
                            <td class="table-title">标题</td>
                            <td class="table-time">创建时间</td>
                            <td class="table-status" id="table-status">
                                状态 <i class="iconfont icon-refresh"></i>
                                <ul class="status-list" id="status-type">
                                    <li class="status-item" data-id="-1">全部</li>
                                    <li class="status-item" data-id="0">未发布</li>
                                    <li class="status-item" data-id="2">已结束</li>
                                    <li class="status-item" data-id="1">已发布</li>
                                </ul>
                            </td>
                            <td class="table-operation">操作</td>
                        </tr>
                    </thead>
                    <tbody id="question-list">
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <!-- 分页 -->
    <div class="pagination clear">
        <a href="javascript:void(0)" class="up" mask="up"><i class="iconfont icon-arrow-left-bold"></i></a>
        <a href="javascript:void(0)" class="down" mask="down"><i
                class="iconfont icon-arrow-right-bold"></i></a>
    </div>
    <div class="bg" id="bg-top-left"></div>
    <div class="bg" id="bg-top-right"></div>
    <div class="bg" id="bg-bottom-left"></div>
    <div class="bg" id="bg-bottom-right"></div>
    <template id="Template">
        <tr>
            <td class="table-choose checkbox-choose">
                <input class="choose-checkbox" type="checkbox" name="select-delete" id="choose-checkbox-{id}"
                    data-id="{id}">
                <label for="choose-checkbox-{id}"></label>
            </td>
            <td class="table-title">
                <pre>{title}</pre>
            </td>
            <td class="table-time">{createTime}</td>
            <td class="table-status ">{status}</td>
            <td class="table-operation" data-id="{id}">
                <button class="btn-icon" data-type="operation-edit"><i class="iconfont icon-edit">编辑</i></button>
                <button class="btn-icon" data-type="operation-write"><i class="iconfont icon-file">填写问卷</i></button>
                <button class="btn-icon" data-type="operation-view"><i class="iconfont icon-data-view">查看数据</i></button>
                <button class="btn-icon" data-type="operation-del"><i class="iconfont icon-ashbin">删除</i></button>
            </td>
        </tr>
    </template>

    <template id="status-template">
        {status} <i class="iconfont icon-refresh"></i>
        <ul class="status-list" id="status-type">
            <li class="status-item" data-id="-1">全部</li>
            <li class="status-item" data-id="0">未发布</li>
            <li class="status-item" data-id="2">已结束</li>
            <li class="status-item" data-id="1">已发布</li>
        </ul>
    </template>

    <div id="message-box" class="message-box"></div>
    <div id="layer-mask"></div>
    <div id="confirm-box" class="confirm-box">
        <a id="close-confirm" class="btn-close"><i class="iconfont icon-close"></i></a>
        <div id="confirm-content" class="confirm-content"></div>
        <div class="confirm-btn-box">
            <button id="btn-confirm" class="btn btn-normal">确定</button>
            <button id="btn-cancel" class="btn btn-cancel">取消</button>
        </div>
    </div>

    <script src="js/index/index.js"></script>
    <script src="js/common/pageIndex.js"></script>
</body>

</html>
